package com.gxa.controller.municipalsys;

import com.gxa.common.R;
import com.gxa.service.OverViewService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

@Controller
@Api(value = "总览",tags = "总览接口API")
@RequestMapping("/overview")
public class    OverViewController {

    @Autowired
    private OverViewService overViewService;

    /**
     * 根据所选地区查询总览
     * @param district
     * @return
     */
    @RequestMapping(value = "/findoverview",method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation(value = "总览接口",notes = "总览",httpMethod = "POST", response = R.class)
    @ApiImplicitParam(name = "district",value = "所选地区",required = true,paramType = "query",dataType = "String")
    @ApiResponses({
            @ApiResponse(code=200,message="查询成功"),
            @ApiResponse(code=401,message="token为空"),
            @ApiResponse(code=1005,message="Token过期"),
            @ApiResponse(code=1006,message="Token验证不通过"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    public R OverView(String district){
        Map rmap = overViewService.findOverViewByDateAndDistrict(district);
        R r = new R();
        r.setCode(200);
        r.setMsg("查询成功");
        r.setData(rmap);
        return r;
    }
}
